insert overwrite table jms_dwd.dwd_tmsnew_shipment_stop_dt partition (dt = '{{ execution_date | cst_ds }}')
  select
     id
     ,shipment_id
     ,shipment_no
     ,sort_num
     ,network_id
     ,network_code
     ,network_name
     ,roadsection_id
     ,planned_arrival_day
     ,planned_arrival_hour
     ,planned_arrival_time
     ,actual_arrival_time
     ,planned_departure_day
     ,planned_departure_hour
     ,planned_departure_time
     ,actual_departure_time
     ,stop_time
     ,usetime
     ,mileage
     ,speed
     ,batch_time
     ,handling_type
     ,load_start_time
     ,load_end_time
     ,unload_start_time
     ,unload_end_time
     ,app_arrival_time
     ,app_departure_time
     ,gps_arrival_time
     ,gps_departure_time
     ,lock_time
     ,unlock_time
     ,weight_arrival_time
     ,weight_departure_time
     ,arrival_gross_weight
     ,arrival_tare_weight
     ,arrival_net_weight
     ,departure_gross_weight
     ,departure_tare_weight
     ,departure_net_weight
     ,estimate_arrival_time
     ,plan_driving_time
     ,actual_driving_time
     ,actual_arrival_time_source
     ,actual_departure_time_source
     ,estimate_batch_time
     ,actual_batch_time
     ,create_by
     ,create_by_name
     ,create_time
     ,update_by
     ,update_by_name
     ,update_time
     ,simple_name
     ,latest_arrival_time
     ,latest_arrival_hour
     ,latest_arrival_day
     ,gps_depart_mileage
     ,gps_arrival_mileage
     ,is_send
     ,null as financial_center_id
     ,null as financial_center_code
     ,null as financial_center_desc
     ,null as clock_time
     ,1 as table_type
   from jms_ods.yl_tmsnew_tms_shipment_stop
      where dt = '{{ execution_date | cst_ds }}'

     union all

  select
     id
     ,shipment_id
     ,shipment_no
     ,sort_num
     ,network_id
     ,network_code
     ,network_name
     ,roadsection_id
     ,planned_arrival_day
     ,planned_arrival_hour
     ,planned_arrival_time
     ,actual_arrival_time
     ,planned_departure_day
     ,planned_departure_hour
     ,planned_departure_time
     ,actual_departure_time
     ,stop_time
     ,usetime
     ,mileage
     ,speed
     ,batch_time
     ,handling_type
     ,load_start_time
     ,load_end_time
     ,unload_start_time
     ,unload_end_time
     ,app_arrival_time
     ,app_departure_time
     ,gps_arrival_time
     ,gps_departure_time
     ,lock_time
     ,unlock_time
     ,weight_arrival_time
     ,weight_departure_time
     ,arrival_gross_weight
     ,arrival_tare_weight
     ,arrival_net_weight
     ,departure_gross_weight
     ,departure_tare_weight
     ,departure_net_weight
     ,estimate_arrival_time
     ,plan_driving_time
     ,actual_driving_time
     ,actual_arrival_time_source
     ,actual_departure_time_source
     ,estimate_batch_time
     ,actual_batch_time
     ,create_by
     ,create_by_name
     ,create_time
     ,update_by
     ,update_by_name
     ,update_time
     ,simple_name
     ,null as latest_arrival_time
     ,null as latest_arrival_hour
     ,null as latest_arrival_day
     ,gps_depart_mileage
     ,gps_arrival_mileage
     ,null as is_send
     ,financial_center_id
     ,financial_center_code
     ,financial_center_desc
     ,clock_time
     ,2 as table_type
   from jms_ods.yl_tmsnew_branch_shipment_stop
      where dt = '{{ execution_date | cst_ds }}'
        distribute by 1
 ;